package org.blogwu.learn.multithread.chapter2.demo9;

public class Main3 {

    static Object o1 = new Object();

    static Object o2 = new Object();

    public static void main(String[] args) {
        new Thread(() -> {
            System.out.println("进入临界区");
            synchronized (o2) {
                try {
                    o1.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        }).start();


    }

}
